<h3>Thêm mới thành viên</h3>
<style type="text/css">
td{
	padding:3px 5px;
}
tr.title td{
	height:22px;
	font-weight:bold;
	text-align:center;
	background:#FFF;
}
fieldset{
	width:400px;
	padding:30px;
	border:1px solid #CCC;
}
legend{
	color:#09F;
}
</style>
<div style="height:30px"></div>
<?php
require("libraries/users.php");
$users = new users();
if(isset($_POST['submit'])){
	$name = $_POST['user'];
	$pass = md5($_POST['pass']);
	$full = $_POST['fullname'];
	$gend = $_POST['gender'];
	$level = $_POST['level'];
	$email = $_POST['email'];
	$phone = $_POST['phone'];
	$checkname = $users->checkuser("user_name",$name);
	$checkemai = $users->checkuser("user_email",$email);
	if($checkname == FALSE || $checkemai == FALSE){
		echo "Người dùng này đã tồn tại!";
	}else{
		$users->add($name,$pass,$full,$gend,$email,$phone,$level);
		header("location:index.php?page=user&act=list");
		exit();
	}
}
?>
<form action="" method="post">
<fieldset>
	<legend>Thêm mới thành viên</legend>
<table width="350" border="0">
  <tr>
    <td width="143">Tên đăng nhập</td>
    <td width="197"><input type="text" name="user" size="25"></td>
  </tr>
  <tr>
    <td>Mật khẩu</td>
    <td><input type="password" name="pass" size="25"></td>
  </tr>
  <tr>
    <td>Họ tên</td>
    <td><input type="text" name="fullname" size="25"></td>
  </tr>
  <tr>
    <td>Giới tính</td>
    <td>
    	<select name="gender">
        	<option value="1">Nam</option>
            <option value="0">Nữ</option>
        </select>
    </td>
  </tr>
  <tr>
    <td>Level</td>
    <td>
    	<select name="level">
        	<option value="1">admin</option>
            <option value="2">Member</option>
        </select>
    </td>
  </tr>
  <tr>
    <td>Số phone</td>
    <td><input type="text" name="phone" size="25"/></td>
  </tr>
  <tr>
    <td>Email</td>
    <td><input type="text" name="email" size="25"/></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input type="submit" name="submit" value="Thêm mới"/></td>
  </tr>
</table>
</fieldset>
</form>